${page.setTitle("push-center| GOPS")}
<style type="text/css">
    .l-table-edit {}
    .l-table-edit-td{ padding:4px;}
    .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
</style>
${token()}
<div class="body-pla-content">
  <form action="" method="post" id="task" name="task">
        <table class="l-table-edit" >
            <tr>
                <td align="right" >任务名称：</td>
                <td align="left" >
						<input name="name" type="text" id="name"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
            <tr>
                <td align="right" >任务类型：</td>
                <td align="left" >
						<input name="type" type="text" id="type"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/>
				</td>
			 </tr> 
            <tr>
                <td align="right" >任务执行间隔(秒)：</td>
                <td align="left" >
						<input name="runPeriod" type="text" id="runPeriod"  maxlength="30" value=""  validate="{required:true,maxlength:30}"/><span>(默认60s)</span>
				</td>
			 </tr> 
             <tr>
				 <td align="right" >备注：</td>
                <td align="left">
                <textarea rows="3" cols="40" name="memo" id="memo" ></textarea>
				</td>
            </tr>  
            <tr>
            	<td></td>
            	<td > <input type="button" value="新增" id="dosubmit" class="l-button l-button-submit"/>  </td>
            	<td align="left"></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">

$(function () {
	$("#dosubmit").click(function(){
		var queryString = $('#task').serializeArray(); 
	    $.ajax({
	        url: "${appServer}/task/add.json",   
	        data: queryString, 
	        type: "POST",
	        success: function(result) {
	        	if(result.hasError) {
					$.ligerDialog.error(result.message);
	        	}else{
	        		$.ligerDialog.success(result.message);
	        		parent.window.search();
	        		parent.$.ligerDialog.close();
	        		parent.$.ligerDialog.hide();
	        	}
	        }
	    });	
		return true;
	});
	
});
</script>